import request from '@/utils/system/request'
import internal from 'stream'

// 获取全部
export function getAll() {
  return request({
    url: '/attendance/all-attendance',
    method: 'get'
  })
}

// 获取数据api
export function getData(data: object) {
  return request({
    url: '/attendance/attendance-list',
    method: 'post',
    data
  })
}

// 新增
export function add(data: object) {
  return request({
    url: '/attendance/attendance',
    method: 'post',
    data
  })
}

// 编辑
export function update(data: object) {
  return request({
    url: '/attendance/attendance',
    method: 'put',
    data
  })
}

// 删除
export function del(data: string[]) {
  return request({
    url: '/attendance/attendance',
    method: 'delete',
    data
  })
}

// 打卡
export function userAttendance() {
  return request({
    url: '/attendance/user-attendance',
    method: 'post'
  })
}

export function exportExcel(data: object) {
  return request({
    url: '/attendance/export-attendance',
    method: 'post',
    responseType: "blob",
    data
  })
}

export function downloadTemplate() {
  return request({
    url: '/attendance/download-template-attendance',
    method: 'post',
    responseType: "blob"
  })
}
